<template>
  <div class="box">
    <div class="top">
      <div class="title_bg">
        <p class="title">实时游客统计</p>
        <p class="bg"></p>
      </div>
      <p class="right">可预约总量<span>99999</span>人</p>
    </div>
    <div class="number">
      <span v-for="(item, index) in people" :key="index">{{ item }}</span>
    </div>
    <!-- 盒子将来echarts展示图形图标的节点 -->
    <div class="charts" ref="charts">123</div>
  </div>
</template>
<script lang="ts">
export default {
  name: "Tourist",
};
</script>
<script setup lang="ts">
import "echarts-liquidfill";
import * as echarts from "echarts";
import { ref, onMounted } from "vue";
let people = ref("215908人");
let charts = ref();
onMounted(() => {
  //获取echarts类的实例
  let mycharts = echarts.init(charts.value);
  //设置实例的配置项
  mycharts.setOption({
    title: {
      text: "水球图",
    },
    xAxis: {},
    yAxis: {},
    series: {
      type: "liquidFill",
      data: [0.6, 0.4, 0.2],
      waveAnimation: true,
      animationDuration: 3,
      animationDurationUpdate: 0,
      radius: "100%",
      outline: {
        show: true,
        borderDistance: 8,
        itemStyle: {
          color: "skyblue",
          borderColor: "#294D99",
          borderWidth: 8,
          shadowBlur: 20,
          shadowColor: "rgba(0, 0, 0, 0.25)",
        },
      },
    },
    grid: {
      left: 0,
      right: 0,
      top: 0,
      bottom: 0,
    },
  });
});
</script>

<style scoped lang="scss">
.box {
  background: url(../../images/dataScreen-main-lb.png) no-repeat;
  background-size: 100% 100%;
  margin-top: 10px;

  .top {
    margin-left: 20px;

    .title_bg {
      display: flex;
      flex-direction: column;
      justify-content: space-between;
      .title {
        color: white;
        font-size: 20px;
      }

      .bg {
        width: 68px;
        height: 7px;
        background: url(../../images/dataScreen-title.png) no-repeat;
        background-size: 100% 100%;
        margin-top: 10px;
      }
    }

    .right {
      float: right;
      color: white;
      font-size: 20px;

      span {
        color: red;
        font-weight: bolder;
      }
    }
  }

  .number {
    padding: 10px;
    margin-top: 30px;
    display: flex;

    span {
      flex: 1;
      height: 40px;
      text-align: center;
      line-height: 40px;
      background: url(../../images/total.png) no-repeat;
      background-size: 100% 100%;
      color: #29fcff;
    }
  }

  .charts {
    width: 100%;
    height: 270px;
  }
}
</style>
